module.exports = logger;

function logger(...str) {
    console.log("%c", "color:#97382D;", getDateString(), ...str);
}

function getDateString() {
    let d = new Date();
    let str = d.getHours().toString();
    let timeStr = "";
    timeStr += (str.length == 1 ? "0" + str : str) + ":";
    str = d.getMinutes().toString();
    timeStr += (str.length == 1 ? "0" + str : str) + ":";
    str = d.getSeconds().toString();
    timeStr += (str.length == 1 ? "0" + str : str) /* + ":" */;
    // str = d.getMilliseconds().toString();
    // if (str.length == 1) str = "00" + str;
    // if (str.length == 2) str = "0" + str;
    // timeStr += str;

    timeStr = "[" + timeStr + "]";
    return timeStr;
}